﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace StyleMVVM.Utilities
{
	public static class DesignMode
	{
		public static bool IsEnabled
		{
			get
			{
#if NETFX_CORE
				return Windows.ApplicationModel.DesignMode.DesignModeEnabled;
#elif WINDOWS_PHONE
				return DesignerProperties.IsInDesignTool;
#else
				var prop = DesignerProperties.IsInDesignModeProperty;

				return (bool)DependencyPropertyDescriptor
					             .FromProperty(prop, typeof(FrameworkElement))
					             .Metadata.DefaultValue;
#endif
			}
		}
	}
}